#!/bin/sh

if [ -f /usr/share/transmission/web/index.html ]; then
	uci -q set 'transmission.@transmission[-1].web_home=/usr/share/transmission/web'
elif [ -f /usr/share/transmission/public_html/index.html ]; then
	uci -q set 'transmission.@transmission[-1].web_home=/usr/share/transmission/public_html'
else
	uci -q delete 'transmission.@transmission[-1].web_home'
fi

uci -q commit transmission

sed -i 's/reload_service(/reload_service0(/g' /etc/init.d/transmission

exit 0
